package test923;

import com.sun.org.apache.xpath.internal.objects.XString;

import java.util.Scanner;

public class second {
    public static void main(String[] args) {


        while(true)
        {
            Scanner scanner = new Scanner(System.in);
            System.out.println("please enter two number:");
            int num1 = scanner.nextInt();
            int num2 = scanner.nextInt();
            System.out.println("enter y out sum,enter n else\ny or n ");
            String y = scanner.next();
            if( y.equals("y"))
            {
                myCalculator(num1,num2);
                break;
            }
            else if(y.equals("n"))
            {
                System.out.println("Continue? If continue please enter y,if exit please enter n\n y or n:");
                String n = scanner.next();
                if(n.equals("y"))
                    continue;
                else
                    break;
            }
        }

    }
    public static void myCalculator(int x,int y)
    {
        System.out.println("x + y = " + (x+y));
    }

}
